const http = uni.$u.http
/*订单确认页及支付页接口*/
// post请求，支付接口
export const savePayInfo = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/payment/savePayInfo', data, config)
// post请求，查询支付状态
// export const checkSerialnoStatus = (data, config = { custom: { type: 'url', hideLoadingFlag: true }}) => http.get('/storepayment/payment/checkSerialnoStatus?paySerialnoId=' + data.paySerialnoId, config)
export const checkSerialnoStatus = (data, config = { custom: { type: 'ycUrl', hideLoadingFlag: true }}) => http.get('/payment/check_serialno_status?serialnoId=' + data.serialnoId, config)
// post请求，商品详情（门店）
export const orderGoodsItems = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/orderGoodsItems', data, config)
// post请求，订单详情(门店)
export const orderInfoByOrderNo = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/orderInfoByOrderNo', data, config)
// post请求，订单锁定
export const lockOrder = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/lockOrder', data, config)
// 易宝支付
export const YBPayment = (data, config = { custom: { type: 'ycUrl' }}) => http.post('/payment/app/combine_pay', data, config)

// 获取可用余额接口
export const queryCreditLines = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/queryCreditLines', data, config)
// 订单确认前校验
export const confirmOrderCheck = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/confirmOrderCheck', data, config)
// 订单确认
export const orderComfirm = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/orderComfirm', data, config)

// 商品编辑完成接口
export const goodseDitor = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/goodseDitor', data, config)
//根据登录账号校验会员状态
export const checkMemeberStatus = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/applet/checkMemeberStatus', data, config)
// 客户自主确认收货
export const customerConfirmReceipt = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/order/customerConfirmReceipt', data, config)

/*支付前校验接口
* @params loginAccount
* @result errorCode=1 查询会员信息异常！ errorCode=6 登录已失效，请重新登录！ errorCode=0 校验通过！*/
export const checkBeforeSave = (data, config = { custom: { type: 'url' }}) => http.post('/storepayment/payment/checkBeforeSave', data, config)
